package com.soup.lab.spring.core.di;

import org.junit.jupiter.api.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

public class SingletonCreationTestCase {

    @Test
    public void testSingletonBean() {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(SingletonBeanConfig.class);
        SingletonBean bean = context.getBean(SingletonBean.class);
        System.out.println(bean);
    }

    @Configuration
    public static class SingletonBeanConfig {
        @Bean
        public SingletonBean singletonBean(){
            return new SingletonBean();
        }
    }

    public static class SingletonBean {

    }




}
